const sequelize = require('../../core/db');
const {Model, DataTypes} = require('sequelize');

class ArticleTag extends Model {
}

ArticleTag.init({
  id: {
    type: DataTypes.INTEGER.UNSIGNED
    , primaryKey: true
    , autoIncrement: true
  }
  , name: {
    type: DataTypes.STRING
    , allowNull: false
    , unique: true
  }
  , order: {
    type: DataTypes.INTEGER
    , allowNull: false
    , defaultValue: 0
  }
}, {
  sequelize
  , tableName: 'articletag' /*←这里即使为articleTag,数据库中实际创建的也是全小写*/
});

module.exports = ArticleTag;
